package com.wangp.procurement.job;

import com.alibaba.fastjson.JSONObject;
import com.wangp.procurement.dto.ProcurementManagementDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import sun.net.www.http.HttpClient;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 第一行简要描述.
 * </p>
 *
 * @author wangping
 * @since 2024-12-15
 */

@Component
public class MyJob {




    @Autowired
    private RestTemplate restTemplate;


    public void getMethod(){

        Map<String, Object> requestParam = new HashMap<>();

//        httpClient.
        ProcurementManagementDto forObject = restTemplate.getForObject("http://localhost:8081/procurement/manage",
                                                                       ProcurementManagementDto.class, requestParam);
        System.out.println(JSONObject.toJSONString(forObject, true));

    }

}
